## Table A6: EEffects of Neighborhood Race and Income on Expected Wait Times: Top 10 City-Service Areas

## install.packages(c("tidyverse", "fixest"))
## library(tidyverse)

## SET WORKING DIRECTORY HERE
## setwd()

## Loading data
## load("dta.RData")

## Subset to top 10 services
dta_top10 = dta %>%
  filter(top10 == 1)

## Column 1
race_wait_across <- feols(log_expected_time ~ factor(white_third) |
                            city^ open_month^open_year, data = dta_top10 %>% filter(city != "New York"), cluster = "geo")

## Column 2
race_wait_within <- feols(log_expected_time ~ factor(white_third) |
                            city_service^ open_month^open_year, data = dta_top10 %>% filter(city != "New York"), cluster = "geo")

## Column 3
inc_wait_across <- feols(log_expected_time ~ factor(inc_third) |
                           city^ open_month^open_year, data = dta_top10 %>% filter(city != "New York"), cluster = "geo")

## Column 4
inc_wait_within <- feols(log_expected_time ~ factor(inc_third) |
                           city_service^ open_month^open_year, data = dta_top10 %>% filter(city != "New York"), cluster = "geo")

TableA6 = etable(race_wait_across, race_wait_within,
                 inc_wait_across, inc_wait_within,
                 signifCode = c("+" = 0.10, "*" = 0.05, "**" = 0.01, "***" = 0.001),
                 digits = 3, fitstat = c("n","r2"))
